#include "WfRestSer.h"
#include <signal.h>
#include <iostream>
using std::cout;

static WFFacilities::WaitGroup wait(1);

void signalhander(int signal)
{
    wait.done();
}

int main()
{
    Dictionary::getInstance()->init();
    signal(SIGINT, signalhander);
    string path = "/home/sakura/all_file/search_engine/conf/config.json";
    Config conf(Configuration::GetInstance(path));
    cout << " config set success\n";
    SplitToolJieba split(Configuration::GetInstance());
    cout << " jieba make success\n";

    WebPageQuery web(&split);
    cout << " init webpagequery\n";
    KeyRecommander reco(Dictionary::getInstance());
   WfRestSer  rest(&web,&reco);
   if(rest.start(1234))
   {
    wait.wait();
    rest.stop();
   }
   else
   {
    cout<<" wrong \n";
   }

}
